package com.hx.reporter.service.impl;

import java.util.List;
import com.hx.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hx.reporter.mapper.FriendApplyMapper;
import com.hx.reporter.domain.FriendApply;
import com.hx.reporter.service.IFriendApplyService;

/**
 * 好友申请Service业务层处理
 * 
 * @author ${author}
 * @date 2023-05-28
 */
@Service
public class FriendApplyServiceImpl implements IFriendApplyService {
    @Autowired
    private FriendApplyMapper friendApplyMapper;

    /**
     * 查询好友申请
     * 
     * @param id 好友申请主键
     * @return 好友申请
     */
    @Override
    public FriendApply selectFriendApplyById(Integer id)
    {
        return friendApplyMapper.selectFriendApplyById(id);
    }

    /**
     * 查询好友申请列表
     * 
     * @param friendApply 好友申请
     * @return 好友申请
     */
    @Override
    public List<FriendApply> selectFriendApplyList(FriendApply friendApply)
    {
        return friendApplyMapper.selectFriendApplyList(friendApply);
    }

    /**
     * 新增好友申请
     * 
     * @param friendApply 好友申请
     * @return 结果
     */
    @Override
    public int insertFriendApply(FriendApply friendApply)
    {
        friendApply.setCreateTime(DateUtils.getNowDate());
        return friendApplyMapper.insertFriendApply(friendApply);
    }

    /**
     * 修改好友申请
     * 
     * @param friendApply 好友申请
     * @return 结果
     */
    @Override
    public int updateFriendApply(FriendApply friendApply)
    {
        return friendApplyMapper.updateFriendApply(friendApply);
    }

    /**
     * 批量删除好友申请
     * 
     * @param ids 需要删除的好友申请主键
     * @return 结果
     */
    @Override
    public int deleteFriendApplyByIds(Integer[] ids)
    {
        return friendApplyMapper.deleteFriendApplyByIds(ids);
    }

    /**
     * 删除好友申请信息
     * 
     * @param id 好友申请主键
     * @return 结果
     */
    @Override
    public int deleteFriendApplyById(Integer id)
    {
        return friendApplyMapper.deleteFriendApplyById(id);
    }
}
